package com.kinyx.framework.db.configs;

import com.kinyx.framework.annotation.assist.CanNotNull;
import com.kinyx.framework.annotation.assist.ReturnNotNull;
import com.kinyx.framework.db.defines.INamingStrategy;
import com.kinyx.framework.utils.KStringUtils;

/**
 * 命名策略实现类
 */
public class NamingStrategyDefault implements INamingStrategy {

	@Override
	@ReturnNotNull
	public String entityName2tableName(@CanNotNull final String entityName) {
		return KStringUtils.hump2underline(entityName).toLowerCase();
	}

	@Override
	@ReturnNotNull
	public String fieldName2columnName(@CanNotNull final String fieldName) {
		return KStringUtils.hump2underline(fieldName).toLowerCase();
	}

}
